package com.ideaplugin.datamanager.model.common;

import lombok.Data;

import java.util.List;

/**
 * @author 赵静波
 * @date 2021-01-18 10:00:16
 */
@Data
public class PageResult<T> extends ListResult<T> {

    private static final long serialVersionUID = 1L;

    /**
     * 分页数
     */

    private Integer pageSize;
    /**
     * 页码
     */

    private Long page;

    /**
     * 记录数
     */
    private Long total;

    public PageResult<T> withData(List<T> data) {
        this.setData(data);
        return this;
    }

    public PageResult(List<T> data) {
        super(data);
    }

    public PageResult() {
    }

    @Override
    public String toString() {
        return "PageResult [pageSize=" + pageSize + ", page=" + page + ", total=" + total + "]";
    }

}
